package controller;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/*
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
*/
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author Christophe Bordier
 * Controleur 1 qui va r�ceptionner les interactions faites par les utilisateurs sur la Vue1
 */
@Controller
@RequestMapping("/Views")
public class BusinessController2 {

	//static final Logger logger = LogManager.getLogger(BusinessController2.class.getName());
	final static Logger LOGGER = Logger.getLogger(BusinessController1.class.getName());
	
	
	public BusinessController2() {
		super();
	}
	
	@RequestMapping(value="/View2" ,method = RequestMethod.GET)
	public String doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		return doPost(request, response);
	}
	
	@RequestMapping(value="/View2" ,method = RequestMethod.POST)
	public String doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		LOGGER.info("Debut de doPost BusinessController2");
		LOGGER.info("originalURI = "+request.getAttribute("originalURI"));
		/*
		if(request.getParameter("action_1")!=null){

		}
		if(request.getParameter("action_2")!=null){

		}
		*/
		return "View2";
	}

}
